package com.example.yoga.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author liwenkai
 * @since 2021-02-20
 */
@TableName("msg")
public class Msg extends Model<Msg> {

    private static final long serialVersionUID = 1L;

    /**
     * 留言表Id
     */
    @TableId(value = "msgId", type = IdType.AUTO)
    private Integer msgid;

    /**
     * 对跳字段
     */
    @TableField("user")
    private Integer user;

    /**
     * 对跳字段
     */
    @TableField("friend")
    private Integer friend;

    /**
     * 发送人
     */
    @TableField("sender")
    private String sender;

    /**
     * 接收人
     */
    @TableField("receiver")
    private String receiver;

    /**
     * 留言主题
     */
    @TableField("title")
    private String title;

    /**
     * 留言内容
     */
    @TableField("content")
    private String content;

    /**
     * 发送留言的时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @TableField("send_time")
    private Date sendTime;

    /**
     * 阅读留言的时间(可以记录点进留言板一瞬间的时间)
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @TableField("read_time")
    private Date readTime;

    /**
     * 留言的状态
     */
    @TableField("status")
    private Integer status;


    public Integer getMsgid() {
        return msgid;
    }

    public void setMsgid(Integer msgid) {
        this.msgid = msgid;
    }

    public Integer getUser() {
        return user;
    }

    public void setUser(Integer user) {
        this.user = user;
    }

    public Integer getFriend() {
        return friend;
    }

    public void setFriend(Integer friend) {
        this.friend = friend;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getReadTime() {
        return readTime;
    }

    public void setReadTime(Date readTime) {
        this.readTime = readTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    protected Serializable pkVal() {
        return this.msgid;
    }

    @Override
    public String toString() {
        return "Msg{" +
        "msgid=" + msgid +
        ", user=" + user +
        ", friend=" + friend +
        ", sender=" + sender +
        ", receiver=" + receiver +
        ", title=" + title +
        ", content=" + content +
        ", sendTime=" + sendTime +
        ", readTime=" + readTime +
        ", status=" + status +
        "}";
    }
}
